package javacode.org.ssh.common.base.util;

import java.util.Collections;
import java.util.List;

public class PaginationSupport implements java.io.Serializable {

	private static final long serialVersionUID = 7030048407899258634L;

	public static final String ASC = "asc";
	
	public static final String DESC = "desc";
	// 排序字段,对应order
	protected String orderBy = null;
	// 排序方式
	protected String order = null;
	//每页显示记录数
	protected int pageSize = PAGESIZE; 
	//默认记录数是10条
	public final static int PAGESIZE = 10;
	//当前记录列表
	@SuppressWarnings("unchecked")
	protected List items = Collections.emptyList();
	//是否自动查询记录总数
	protected boolean autoCount = false;  
	//记录总数
	protected int totalCount = 0; 
	//当前页的开始记录号
	protected int startIndex = 0; 
	//当前第几页
	protected int pageNo = 1;
	//共多少页
	protected int totalPage = 1;
	//条件过虑列表
	protected List<PropertyFilter> filters;
	// 当前取的类名称
	@SuppressWarnings("unchecked")
	protected Class clazz; 
	
	public String getOrderBy() {
		return orderBy;
	}
	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}
	public String getOrder() {
		return order;
	}
	public void setOrder(String order) {
		this.order = order;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	@SuppressWarnings("unchecked")
	public List getItems() {
		return items;
	}
	@SuppressWarnings("unchecked")
	public void setItems(List items) {
		this.items = items;
	}
	public boolean isAutoCount() {
		return autoCount;
	}
	public void setAutoCount(boolean autoCount) {
		this.autoCount = autoCount;
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	public int getStartIndex() {
		return startIndex;
	}
	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public List<PropertyFilter> getFilters() {
		return filters;
	}
	public void setFilters(List<PropertyFilter> filters) {
		this.filters = filters;
	}
	public Class getClazz() {
		return clazz;
	}
	public void setClazz(Class clazz) {
		this.clazz = clazz;
	} 
	
	
}
